<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" scope="page" var="CONTENT_LOCALES_COLLECTION_KEY" />
<atleap:content identifier="information" ignore="true" />
<table cellpadding="0" cellspacing="0" border="0" class="tableView">
    <tr>
        <th align="left" width="50%"><atleap:message key="core.contentLocale.form.identifier" /></th>
        <td><c:out value="${requestScope.contentLocale.identifier}" escapeXml="true" /></td>
    </tr>
	<tr>
		<th>
			<atleap:message key="core.contentLocale.form.title" />
		</th>
		<td>
			<atleap:iterator items="${sessionScope[pageScope.CONTENT_LOCALES_COLLECTION_KEY]}" var="contentLocale">
				<div class="readOnlyField">
					<atleap:fieldValue valueMap="${contentLocale.title}" var="languageTitle" />
					<c:if test="${empty languageTitle}">
						<c:set var="languageTitle" value="${contentLocale.identifier}" />
					</c:if>
					<atleap:fieldValue valueMap="${requestScope.contentLocale.title}" var="localeTitle" language="${contentLocale.identifier}" />
					<c:if test="${empty localeTitle}">
						<c:set var="localeTitle" value="${requestScope.contentLocale.identifier}" />
					</c:if>
					${languageTitle}:&nbsp;${localeTitle}
				</div>
			</atleap:iterator>
		</td>
	</tr>
    <tr>
        <th align="left" width="50%"><atleap:message key="core.contentLocale.form.defaultInstance" /></th>
        <td>
            <c:choose>
                <c:when test="${requestScope.contentLocale.defaultInstance}">
                    <atleap:message key="core.commons.boolean.true"/>
                </c:when>
                <c:otherwise>
                    <atleap:message key="core.commons.boolean.false"/>
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    <tr>
        <th align="left" width="50%"><atleap:message key="core.contentLocale.form.enabled" /></th>
        <td>
            <c:choose>
                <c:when test="${requestScope.contentLocale.enabled}">
                    <atleap:message key="core.commons.boolean.true"/>
                </c:when>
                <c:otherwise>
                    <atleap:message key="core.commons.boolean.false"/>
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    <tr>
        <th align="left" width="50%"><atleap:message key="core.contentLocale.form.active" /></th>
        <td>
            <c:choose>
                <c:when test="${requestScope.contentLocale.active}">
                    <atleap:message key="core.commons.boolean.true"/>
                </c:when>
                <c:otherwise>
                    <atleap:message key="core.commons.boolean.false"/>
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
</table>
<atleap:form action="core/contentLocale/callUpdate" method="GET" validateOnSubmit="false">
	<html:hidden property="identifier" value="${requestScope.contentLocale.identifier}" />
    <atleap:isUserInRole roles="core-contentLocale-update">
	    <atleap:submit styleClass="button"><atleap:message key="core.commons.buttons.callUpdate" /></atleap:submit>
    </atleap:isUserInRole>
	<atleap:cancel styleClass="button"><atleap:message key="core.commons.buttons.showList" /></atleap:cancel>
</atleap:form>

